#ifndef __APP_FLASH_H__
#define __APP_FLASH_H__

#include <stdint.h>

#define FLASH_SECTOR_NUM (12u)											   /* flash扇区总数 */
#define FLASH_PARTB_SECTOR_NUM (2u)										   /* b区所占扇区数量 */
#define FLASH_PARTA_SECTOR_NUM (FLASH_SECTOR_NUM - FLASH_PARTB_SECTOR_NUM) /* a区所占扇区数量 */
#define FLASH_PARTA_START_SECTOR FLASH_PARTB_SECTOR_NUM					   /* a区首扇区索引号 */

extern uint32_t flash_sector_base_addr[12]; /* 各扇区起始地址 */

void flash_rw_test(void);
uint8_t flash_parta_erase(void);
void flash_program(uint32_t addr, const uint32_t *data, uint32_t len);

#endif /* __APP_FLASH_H__ */
